\(\int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx\) [9]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 32, antiderivative size = 86 \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^2 c \text {arctanh}(\cos (e+f x))}{8 f}-\frac {a^2 c \cot ^3(e+f x)}{3 f}+\frac {a^2 c \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 c \cot (e+f x) \csc ^3(e+f x)}{4 f} \]

[Out]

1/8*a^2*c*arctanh(cos(f*x+e))/f-1/3*a^2*c*cot(f*x+e)^3/f+1/8*a^2*c*cot(f*x+e)*csc(f*x+e)/f-1/4*a^2*c*cot(f*x+e
)*csc(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {3045, 3852, 8, 3853, 3855} \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^2 c \text {arctanh}(\cos (e+f x))}{8 f}-\frac {a^2 c \cot ^3(e+f x)}{3 f}-\frac {a^2 c \cot (e+f x) \csc ^3(e+f x)}{4 f}+\frac {a^2 c \cot (e+f x) \csc (e+f x)}{8 f} \]

[In]

Int[Csc[e + f*x]^5*(a + a*Sin[e + f*x])^2*(c - c*Sin[e + f*x]),x]

[Out]

(a^2*c*ArcTanh[Cos[e + f*x]])/(8*f) - (a^2*c*Cot[e + f*x]^3)/(3*f) + (a^2*c*Cot[e + f*x]*Csc[e + f*x])/(8*f) -
 (a^2*c*Cot[e + f*x]*Csc[e + f*x]^3)/(4*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3045

Int[sin[(e_.) + (f_.)*(x_)]^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.
)*(x_)]), x_Symbol] :> Int[ExpandTrig[sin[e + f*x]^n*(a + b*sin[e + f*x])^m*(A + B*sin[e + f*x]), x], x] /; Fr
eeQ[{a, b, e, f, A, B}, x] && EqQ[A*b + a*B, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && IntegerQ[n]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (-a^2 c \csc ^2(e+f x)-a^2 c \csc ^3(e+f x)+a^2 c \csc ^4(e+f x)+a^2 c \csc ^5(e+f x)\right ) \, dx \\ & = -\left (\left (a^2 c\right ) \int \csc ^2(e+f x) \, dx\right )-\left (a^2 c\right ) \int \csc ^3(e+f x) \, dx+\left (a^2 c\right ) \int \csc ^4(e+f x) \, dx+\left (a^2 c\right ) \int \csc ^5(e+f x) \, dx \\ & = \frac {a^2 c \cot (e+f x) \csc (e+f x)}{2 f}-\frac {a^2 c \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {1}{2} \left (a^2 c\right ) \int \csc (e+f x) \, dx+\frac {1}{4} \left (3 a^2 c\right ) \int \csc ^3(e+f x) \, dx+\frac {\left (a^2 c\right ) \text {Subst}(\int 1 \, dx,x,\cot (e+f x))}{f}-\frac {\left (a^2 c\right ) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (e+f x)\right )}{f} \\ & = \frac {a^2 c \text {arctanh}(\cos (e+f x))}{2 f}-\frac {a^2 c \cot ^3(e+f x)}{3 f}+\frac {a^2 c \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 c \cot (e+f x) \csc ^3(e+f x)}{4 f}+\frac {1}{8} \left (3 a^2 c\right ) \int \csc (e+f x) \, dx \\ & = \frac {a^2 c \text {arctanh}(\cos (e+f x))}{8 f}-\frac {a^2 c \cot ^3(e+f x)}{3 f}+\frac {a^2 c \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 c \cot (e+f x) \csc ^3(e+f x)}{4 f} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(179\) vs. \(2(86)=172\).

Time = 0.22 (sec) , antiderivative size = 179, normalized size of antiderivative = 2.08 \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^2 c \cot (e+f x)}{3 f}+\frac {a^2 c \csc ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}-\frac {a^2 c \csc ^4\left (\frac {1}{2} (e+f x)\right )}{64 f}-\frac {a^2 c \cot (e+f x) \csc ^2(e+f x)}{3 f}+\frac {a^2 c \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {a^2 c \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {a^2 c \sec ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}+\frac {a^2 c \sec ^4\left (\frac {1}{2} (e+f x)\right )}{64 f} \]

[In]

Integrate[Csc[e + f*x]^5*(a + a*Sin[e + f*x])^2*(c - c*Sin[e + f*x]),x]

[Out]

(a^2*c*Cot[e + f*x])/(3*f) + (a^2*c*Csc[(e + f*x)/2]^2)/(32*f) - (a^2*c*Csc[(e + f*x)/2]^4)/(64*f) - (a^2*c*Co
t[e + f*x]*Csc[e + f*x]^2)/(3*f) + (a^2*c*Log[Cos[(e + f*x)/2]])/(8*f) - (a^2*c*Log[Sin[(e + f*x)/2]])/(8*f) -
 (a^2*c*Sec[(e + f*x)/2]^2)/(32*f) + (a^2*c*Sec[(e + f*x)/2]^4)/(64*f)

Maple [A] (verified)

Time = 1.07 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.27

method result size
parallelrisch \(-\frac {a^{2} c \left (-3 \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-8 \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+24 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+24 \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-24 \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+8 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+3\right )}{192 f \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}\) \(109\)
derivativedivides \(\frac {a^{2} c \cot \left (f x +e \right )-a^{2} c \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )+a^{2} c \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (f x +e \right )\right )}{3}\right ) \cot \left (f x +e \right )+a^{2} c \left (\left (-\frac {\left (\csc ^{3}\left (f x +e \right )\right )}{4}-\frac {3 \csc \left (f x +e \right )}{8}\right ) \cot \left (f x +e \right )+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )}{f}\) \(129\)
default \(\frac {a^{2} c \cot \left (f x +e \right )-a^{2} c \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )+a^{2} c \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (f x +e \right )\right )}{3}\right ) \cot \left (f x +e \right )+a^{2} c \left (\left (-\frac {\left (\csc ^{3}\left (f x +e \right )\right )}{4}-\frac {3 \csc \left (f x +e \right )}{8}\right ) \cot \left (f x +e \right )+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )}{f}\) \(129\)
risch \(-\frac {a^{2} c \left (3 \,{\mathrm e}^{7 i \left (f x +e \right )}+21 \,{\mathrm e}^{5 i \left (f x +e \right )}-24 i {\mathrm e}^{6 i \left (f x +e \right )}+21 \,{\mathrm e}^{3 i \left (f x +e \right )}+24 i {\mathrm e}^{4 i \left (f x +e \right )}+3 \,{\mathrm e}^{i \left (f x +e \right )}-8 i {\mathrm e}^{2 i \left (f x +e \right )}+8 i\right )}{12 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{4}}+\frac {a^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{8 f}-\frac {a^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{8 f}\) \(149\)
norman \(\frac {-\frac {a^{2} c}{64 f}-\frac {a^{2} c \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}-\frac {3 a^{2} c \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{32 f}-\frac {5 a^{2} c \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{32 f}-\frac {a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{24 f}-\frac {3 a^{2} c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{64 f}+\frac {a^{2} c \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}-\frac {a^{2} c \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}+\frac {3 a^{2} c \left (\tan ^{12}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{64 f}+\frac {a^{2} c \left (\tan ^{13}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{24 f}+\frac {a^{2} c \left (\tan ^{14}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{64 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}-\frac {a^{2} c \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}\) \(256\)

[In]

int(csc(f*x+e)^5*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

-1/192*a^2*c*(-3*tan(1/2*f*x+1/2*e)^8-8*tan(1/2*f*x+1/2*e)^7+24*ln(tan(1/2*f*x+1/2*e))*tan(1/2*f*x+1/2*e)^4+24
*tan(1/2*f*x+1/2*e)^5-24*tan(1/2*f*x+1/2*e)^3+8*tan(1/2*f*x+1/2*e)+3)/f/tan(1/2*f*x+1/2*e)^4

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 166 vs. \(2 (78) = 156\).

Time = 0.26 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.93 \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=-\frac {16 \, a^{2} c \cos \left (f x + e\right )^{3} \sin \left (f x + e\right ) + 6 \, a^{2} c \cos \left (f x + e\right )^{3} + 6 \, a^{2} c \cos \left (f x + e\right ) - 3 \, {\left (a^{2} c \cos \left (f x + e\right )^{4} - 2 \, a^{2} c \cos \left (f x + e\right )^{2} + a^{2} c\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 3 \, {\left (a^{2} c \cos \left (f x + e\right )^{4} - 2 \, a^{2} c \cos \left (f x + e\right )^{2} + a^{2} c\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{48 \, {\left (f \cos \left (f x + e\right )^{4} - 2 \, f \cos \left (f x + e\right )^{2} + f\right )}} \]

[In]

integrate(csc(f*x+e)^5*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x, algorithm="fricas")

[Out]

-1/48*(16*a^2*c*cos(f*x + e)^3*sin(f*x + e) + 6*a^2*c*cos(f*x + e)^3 + 6*a^2*c*cos(f*x + e) - 3*(a^2*c*cos(f*x
 + e)^4 - 2*a^2*c*cos(f*x + e)^2 + a^2*c)*log(1/2*cos(f*x + e) + 1/2) + 3*(a^2*c*cos(f*x + e)^4 - 2*a^2*c*cos(
f*x + e)^2 + a^2*c)*log(-1/2*cos(f*x + e) + 1/2))/(f*cos(f*x + e)^4 - 2*f*cos(f*x + e)^2 + f)

Sympy [F(-1)]

Timed out. \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\text {Timed out} \]

[In]

integrate(csc(f*x+e)**5*(a+a*sin(f*x+e))**2*(c-c*sin(f*x+e)),x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 165 vs. \(2 (78) = 156\).

Time = 0.20 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.92 \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {3 \, a^{2} c {\left (\frac {2 \, {\left (3 \, \cos \left (f x + e\right )^{3} - 5 \, \cos \left (f x + e\right )\right )}}{\cos \left (f x + e\right )^{4} - 2 \, \cos \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\cos \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - 12 \, a^{2} c {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + \frac {48 \, a^{2} c}{\tan \left (f x + e\right )} - \frac {16 \, {\left (3 \, \tan \left (f x + e\right )^{2} + 1\right )} a^{2} c}{\tan \left (f x + e\right )^{3}}}{48 \, f} \]

[In]

integrate(csc(f*x+e)^5*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/48*(3*a^2*c*(2*(3*cos(f*x + e)^3 - 5*cos(f*x + e))/(cos(f*x + e)^4 - 2*cos(f*x + e)^2 + 1) - 3*log(cos(f*x +
 e) + 1) + 3*log(cos(f*x + e) - 1)) - 12*a^2*c*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) +
log(cos(f*x + e) - 1)) + 48*a^2*c/tan(f*x + e) - 16*(3*tan(f*x + e)^2 + 1)*a^2*c/tan(f*x + e)^3)/f

Giac [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.63 \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {3 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 8 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 24 \, a^{2} c \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) - 24 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + \frac {50 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 24 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 8 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 3 \, a^{2} c}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4}}}{192 \, f} \]

[In]

integrate(csc(f*x+e)^5*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x, algorithm="giac")

[Out]

1/192*(3*a^2*c*tan(1/2*f*x + 1/2*e)^4 + 8*a^2*c*tan(1/2*f*x + 1/2*e)^3 - 24*a^2*c*log(abs(tan(1/2*f*x + 1/2*e)
)) - 24*a^2*c*tan(1/2*f*x + 1/2*e) + (50*a^2*c*tan(1/2*f*x + 1/2*e)^4 + 24*a^2*c*tan(1/2*f*x + 1/2*e)^3 - 8*a^
2*c*tan(1/2*f*x + 1/2*e) - 3*a^2*c)/tan(1/2*f*x + 1/2*e)^4)/f

Mupad [B] (verification not implemented)

Time = 11.53 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.55 \[ \int \csc ^5(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{24\,f}-\frac {a^2\,c\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{8\,f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (-2\,c\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\frac {2\,c\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{3}+\frac {c\,a^2}{4}\right )}{16\,f}+\frac {a^2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4}{64\,f}-\frac {a^2\,c\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{8\,f} \]

[In]

int(((a + a*sin(e + f*x))^2*(c - c*sin(e + f*x)))/sin(e + f*x)^5,x)

[Out]

(a^2*c*tan(e/2 + (f*x)/2)^3)/(24*f) - (a^2*c*tan(e/2 + (f*x)/2))/(8*f) - (cot(e/2 + (f*x)/2)^4*((a^2*c)/4 + (2
*a^2*c*tan(e/2 + (f*x)/2))/3 - 2*a^2*c*tan(e/2 + (f*x)/2)^3))/(16*f) + (a^2*c*tan(e/2 + (f*x)/2)^4)/(64*f) - (
a^2*c*log(tan(e/2 + (f*x)/2)))/(8*f)